package com.admgt.resource.ui;

import javax.swing.JTable;

public class FileTable extends JTable {
	private static final long serialVersionUID = 1L;
	Object[][] tableData;
    String[] tableTitle;
	public FileTable(Object[][] tableData, String[] tableTitle) {
		super();
		this.tableData = tableData;
		this.tableTitle = tableTitle;
		init(tableData, tableTitle);
	}
	private void init(Object[][] tableData, String[] tableTitle) {
			this.setModel(new javax.swing.table.DefaultTableModel(
								tableData, tableTitle) {
				private static final long serialVersionUID = 6305935297034159169L;
				@SuppressWarnings("unchecked")
				Class[] types = new Class[] { java.lang.String.class,
						java.lang.Long.class, java.lang.String.class,
						java.lang.Object.class, java.lang.String.class,
						java.lang.Integer.class };

				@SuppressWarnings("unchecked")
				public Class getColumnClass(int columnIndex) {
					return types[columnIndex];
				}
			});
	}
	
	public void updateTableData(Object[][] tableData, String[] tableTitle) {
		this.setModel(new javax.swing.table.DefaultTableModel(
							tableData, tableTitle) {
			private static final long serialVersionUID = 6305935297034159169L;
			@SuppressWarnings("unchecked")
			Class[] types = new Class[] { java.lang.String.class,
					java.lang.Long.class, java.lang.String.class,
					java.lang.Object.class, java.lang.String.class,
					java.lang.Integer.class };

			@SuppressWarnings("unchecked")
			public Class getColumnClass(int columnIndex) {
				return types[columnIndex];
			}
		});
}
	

}
